package chapter10

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/12 20:35
  * @history:
  *          1.2019/1/12 created by chuhaitao
  */
object TestInner {
  def main(args: Array[String]): Unit = {

    val outclass1: OutClass = new OutClass()
    val outclass2: OutClass = new OutClass()
    /*创建内部类*/
    val innerClass1 = new outclass1.InnerClass
    val innerClass2 = new outclass2.InnerClass
    /*创建静态内部类*/
    val innerStaticClass1 = new OutClass.InnerStaticClass
    //类型投影：
    innerClass1.info(innerClass1)
    innerClass1.info(innerClass2)
  }

}

class OutClass {

  class InnerClass {
    //类型投影，不加OutClass#，内部对象必须是指定的外部对象
    def info(inner: OutClass#InnerClass): Unit = {
      print("innerClass+" + inner)
    }
  }

}


object OutClass {

  class InnerStaticClass {


  }

}
